package com.zxy.controller;

import com.zxy.model.WareHouse;
import com.zxy.model.WareHouseQuery;
import com.zxy.service.WareHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/warehouse") //restFul
public class WareHouseController {
    @Autowired
    private WareHouseService wareHouseService;

    @GetMapping
    public List<WareHouse> select(WareHouseQuery query) {
        return wareHouseService.select(query);
    }
    @PostMapping
    public int insert(@RequestBody WareHouse model) {
        return wareHouseService.insert(model);
    }
    @PutMapping
    public int update(@RequestBody WareHouse model){
        return wareHouseService.update(model);
    }
    @DeleteMapping
    public int delete(Integer id){
        return wareHouseService.delete(id);
    }
}
